#ifndef __QUEUE_H__
#define __QUEUE_H__

//define stack return code
#define QUEUE_OK        0
#define QUEUE_FULL      -1
#define QUEUE_EMPTY     -2
#define QUEUE_FAIL      -3



struct queue {
    int *elements;
    unsigned int capacity; //sizeof elements
    unsigned int size;  // number node in queue
    int front;  // 
};

typedef struct queue queue_t;


//interface (operation of queue)

int init(queue_t *, int capacity); // return QUEUE_FAIL if malloc error
int enqueue(queue_t *, int);   //return QUEUE_FULL if error
// retVaule =  front of queue and return QUEUE_OK if queue is not empty, 
// otherwise return QUEUE_EMPTY
int dequeue(queue_t *, int* retValue); 

int isFULL(queue_t *);  //return 1 if queue is full
int isEmpty(queue_t *); // return 1 if queue is empty
// return 1 if x is contained in stack
int isExist(queue_t *, int x);

#endif